/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2011
 */

package com.core.basic.secure.domain;

import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.springframework.web.bind.annotation.RequestMethod;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;
import common.base.*;
import common.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.util.page.*;
import cn.org.rapid_framework.page.*;


import com.core.basic.secure.domain.*;
import com.core.basic.secure.dao.*;
import com.core.basic.secure.service.*;
import com.core.basic.secure.query.*;

/**
 * @author badqiu
 * @author hunhun
 * @since 4.0 
 */


public class Resources implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Resources";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_NAME = "name";
	public static final String ALIAS_TYPE = "type";
	public static final String ALIAS_PRIORITY = "priority";
	public static final String ALIAS_URL = "url";
	public static final String ALIAS_MEMO = "memo";
	public static Map<Integer,String> TYPEMAP=new HashMap<Integer,String>();
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Long id;
	@Length(max=255)
	private java.lang.String name;
	
	private java.lang.Integer type;
	
	private java.lang.Integer priority;
	@Length(max=255)
	private java.lang.String url;
	@Length(max=255)
	private java.lang.String memo;
	//columns END

	public Resources(){
	}

	public Resources(
		java.lang.Long id
	){
		this.id = id;
	}

	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	public java.lang.Long getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setType(java.lang.Integer value) {
		this.type = value;
	}
	
	public java.lang.Integer getType() {
		return this.type;
	}
	public void setPriority(java.lang.Integer value) {
		this.priority = value;
	}
	
	public java.lang.Integer getPriority() {
		return this.priority;
	}
	public void setUrl(java.lang.String value) {
		this.url = value;
	}
	
	public java.lang.String getUrl() {
		return this.url;
	}
	public void setMemo(java.lang.String value) {
		this.memo = value;
	}
	
	public java.lang.String getMemo() {
		return this.memo;
	}
	
	private Set rolesHasResourcess = new HashSet(0);
	public void setRolesHasResourcess(Set rolesHasResourcess){
		this.rolesHasResourcess = rolesHasResourcess;
	}
	
	public Set getRolesHasResourcess() {
		return rolesHasResourcess;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("Type",getType())
			.append("Priority",getPriority())
			.append("Url",getUrl())
			.append("Memo",getMemo())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Resources == false) return false;
		if(this == obj) return true;
		Resources other = (Resources)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

